home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Programming / powerd / modules.lha / modules / libraries / render.m < prev    next >
Encoding:
Text File  |  1999-09-10  |  9.7 KB  |  298 lines

  1. MODULE    'utility/tagitem'
  2.  
  3. #define    RND_TAGBASE    (TAG_USER+$1000)
  4.  
  5. /************************************************************************
  6.  
  7.     memhandler
  8.  
  9. ************************************************************************/
  10.  
  11. #define    RND_MemType        (RND_TAGBASE+1)        /* type of memhandler, see below */
  12. #define    RND_MemBlock    (RND_TAGBASE+2)        /* ptr to block of memory */
  13. #define    RND_MemSize        (RND_TAGBASE+3)        /* size of memblock [bytes] */
  14. #define    RND_MemFlags    (RND_TAGBASE+18)    /* memflags (exec/memory.h) */
  15. #define    RND_RMHandler    (RND_TAGBASE+12)    /* to pass a memhandler as an argument */
  16.  
  17. /*
  18.  *    memhandler types
  19.  */
  20.  
  21. #define    RMHTYPE_POOL        1                /* v39 exec dynamic pool */
  22. #define    RMHTYPE_PRIVATE        2                /* private memory pool */
  23. #define    RMHTYPE_PUBLIC        3                /* common public memory */
  24.  
  25.  
  26. /************************************************************************
  27.  
  28.     palette
  29.  
  30. ************************************************************************/
  31.  
  32. #define    RND_PaletteFormat    (RND_TAGBASE+19)    /* palette import/export format */
  33. #define    RND_EHBPalette        (RND_TAGBASE+22)    /* tag to indicate a palette is EHB */
  34. #define    RND_FirstColor        (RND_TAGBASE+23)    /* first palette entry */
  35. #define    RND_NewPalette        (RND_TAGBASE+24)    /* dispose the old palette and load a new one */
  36. #define    RND_RGBWeight        (RND_TAGBASE+11)    /* quantization factors */
  37.  
  38. /*
  39.  *    palette format types
  40.  */
  41.  
  42. #define    PALFMT_RGB32        1                    /* ULONG red,green,blue */
  43. #define    PALFMT_RGB8            2                    /* ULONG $00rrggbb */
  44. #define    PALFMT_RGB4            3                    /* UWORD $rgb */
  45. #define    PALFMT_PALETTE        4                    /* render.library palette */
  46.  
  47. /*
  48.  *    palette sort mode types
  49.  *    for the use with SortPalette()
  50.  */
  51.  
  52.     /* no particular order */
  53. #define    PALMODE_NONE            $0000
  54.  
  55.     /* sort palette entries by brightness */
  56. #define    PALMODE_BRIGHTNESS        $0001
  57.  
  58.     /* sort palette entries by the number of pixels that they represent.
  59.        You must supply the RND_Histogram taglist argument. */
  60. #define    PALMODE_POPULARITY        $0002
  61.  
  62.     /* sort palette entries by the number of histogram entries that they
  63.        represent. You must supply the RND_Histogram taglist argument. */
  64. #define    PALMODE_REPRESENTATION    $0003
  65.  
  66.     /* sort palette entries by their optical significance for the human
  67.        eye. Implementation is unknown to you and may change.
  68.        You must supply the RND_Histogram taglist argument. */
  69. #define PALMODE_SIGNIFICANCE    $0004
  70.  
  71.     /* sort palette entries by color intensity */
  72. #define    PALMODE_SATURATION        $0005
  73.  
  74.     /* By default, sort direction is descending, i.e. the precedence is
  75.        more-to-less. Combine with this flag to invert the sort direction. */
  76. #define    PALMODE_ASCENDING        $0008
  77.  
  78.  
  79. /************************************************************************
  80.  
  81.     histogram related
  82.  
  83. ************************************************************************/
  84.  
  85. #define    RND_HSType            (RND_TAGBASE+4)        /* histogram type, see below */
  86. #define    RND_Histogram        (RND_TAGBASE+9)        /* a histogram as an argument */
  87.  
  88. /*
  89.  *    Histogram / Palette types
  90.  *    to be specified with RND_HSType
  91.  */
  92.  
  93. #define    HSTYPE_12BIT        4                    /* 12bit dynamic histogram */
  94. #define    HSTYPE_15BIT        5                    /* 15bit dynamic histogram */
  95. #define    HSTYPE_18BIT        6                    /* 18bit dynamic histogram */
  96. #define    HSTYPE_21BIT        7                    /* 21bit dynamic histogram */
  97. #define    HSTYPE_24BIT        8                    /* 24bit dynamic histogram */
  98. #define    HSTYPE_12BIT_TURBO    20                    /* 12bit tabular histogram */
  99. #define    HSTYPE_15BIT_TURBO    21                    /* 15bit tabular histogram */
  100. #define    HSTYPE_18BIT_TURBO    22                    /* 18bit tabular histogram */
  101.  
  102. /*
  103.  *    tags that can be queried via QueryHistogram()
  104.  */
  105.  
  106. #define    RND_NumPixels        (RND_TAGBASE+5)        /* # pixels in a histogram */
  107. #define    RND_NumColors        (RND_TAGBASE+6)        /* # colors in a histogram */
  108.  
  109.  
  110. /************************************************************************
  111.  
  112.     rendering and conversions
  113.  
  114. ************************************************************************/
  115.  
  116. #define    RND_ColorMode        (RND_TAGBASE+7)        /* color mode, see below */
  117. #define    RND_DitherMode        (RND_TAGBASE+8)        /* dither mode, see below */
  118. #define    RND_DitherAmount    (RND_TAGBASE+26)    /* dither amount */
  119. #define    RND_OffsetColorZero    (RND_TAGBASE+10)    /* first color index to be output */
  120.  
  121. /*
  122.  *    color mode types
  123.  *    to be specified with RND_ColorMode
  124.  */
  125.  
  126. #define    COLORMODE_CLUT        $0000                /* normal palette lookup */
  127. #define    COLORMODE_HAM8        $0001                /* HAM8 mode */
  128. #define    COLORMODE_HAM6        $0002                /* HAM6 mode */
  129. #define    COLORMODE_MASK        $0003                /* mask to determine COLORMODE */
  130.  
  131. /*
  132.  *    dither mode types
  133.  *    to be specified with RND_DitherMode
  134.  */
  135.  
  136. #define    DITHERMODE_NONE    $0000                /* no dither */
  137. #define    DITHERMODE_FS        $0001                /* Floyd-Steinberg dither */
  138. #define    DITHERMODE_RANDOM    $0002                /* random dither. amount required. */
  139. #define    DITHERMODE_EDD        $0003                /* EDD dither */
  140.  
  141.  
  142. /************************************************************************
  143.  
  144.     miscellaneous
  145.  
  146. ************************************************************************/
  147.  
  148. #define    RND_ProgressHook    (RND_TAGBASE+13)    /* progress callback hook */
  149. #define    RND_SourceWidth    (RND_TAGBASE+14)    /* total input width [pixels] */
  150. #define    RND_DestWidth        (RND_TAGBASE+15)    /* total output width [pixels] */
  151. #define    RND_PenTable        (RND_TAGBASE+16)    /* ptr to a chunky conversion table */
  152. #define    RND_LeftEdge        (RND_TAGBASE+17)    /* chunky data left edge [pixels] */
  153. #define    RND_LineHook         (RND_TAGBASE+20)    /* line callback hook */
  154. #define    RND_MapEngine        (RND_TAGBASE+27)    /* Mapping-Engine */
  155. #define    RND_Interleave        (RND_TAGBASE+28)    /* Interleave */
  156. #define    RND_Palette            (RND_TAGBASE+29)    /* Palette */
  157. #define    RND_Weight            (RND_TAGBASE+30)    /* Weight factor */
  158. #define    RND_ScaleEngine    (RND_TAGBASE+31)    /* ScaleEngine */
  159. #define    RND_DestCoordinates    (RND_TAGBASE+42)    /* Texture coordinates */
  160. #define    RND_BGColor            (RND_TAGBASE+43)    /* backcolor for filling */
  161. #define    RND_BGPen            (RND_TAGBASE+44)    /* backpen for filling */
  162.  
  163.  
  164. /************************************************************************
  165.  
  166.     alpha-channel and masking
  167.  
  168. ************************************************************************/
  169.  
  170. #define    RND_AlphaChannel    (RND_TAGBASE+32)    /* custom alpha-channel */
  171. #define    RND_AlphaModulo    (RND_TAGBASE+33)    /* bytes between alpha-channel pixels */
  172. #define    RND_AlphaWidth        (RND_TAGBASE+34)    /* width of alpha-channel array */
  173. #define    RND_MaskRGB            (RND_TAGBASE+35)    /* masking RGB for CreateAlphaArray */
  174. #define    RND_MaskFalse        (RND_TAGBASE+36)    /* mask value for outside color range */
  175. #define    RND_MaskTrue        (RND_TAGBASE+37)    /* mask value for inside color range */
  176.  
  177. #define    RND_SourceWidth2    (RND_TAGBASE+38)    /* total source width for 3channel operations */
  178. #define    RND_AlphaChannel2    (RND_TAGBASE+39)    /* second custom alpha-channel */
  179. #define    RND_AlphaModulo2    (RND_TAGBASE+40)    /* pixel modulo for a second alpha-channel */
  180. #define    RND_AlphaWidth2    (RND_TAGBASE+41)    /* width of a second alpha-channel array */
  181.  
  182.  
  183. /************************************************************************
  184.  
  185.     PixelFormat
  186.  
  187. ************************************************************************/
  188.  
  189. #define    RND_PixelFormat    (RND_TAGBASE+25)        /* pixel format, see below */
  190.  
  191. #define    PIXFMTB_CHUNKY        3
  192. #define    PIXFMTB_BITMAP        4
  193. #define    PIXFMTB_RGB            5
  194.  
  195. #define    PIXFMT_CHUNKY_CLUT    (1<<PIXFMTB_CHUNKY+COLORMODE_CLUT)
  196. #define    PIXFMT_0RGB_32            (1<<PIXFMTB_RGB)
  197.  
  198. /*
  199.  *    these types are currently not used by render.library, but
  200.  *    some of them are applicable for guigfx.library functions:
  201.  */
  202.  
  203. #define    PIXFMT_CHUNKY_HAM8    (1<<PIXFMTB_CHUNKY+COLORMODE_HAM8)
  204. #define    PIXFMT_CHUNKY_HAM6    (1<<PIXFMTB_CHUNKY+COLORMODE_HAM6)
  205. #define    PIXFMT_BITMAP_CLUT    (1<<PIXFMTB_BITMAP+COLORMODE_CLUT)
  206. #define    PIXFMT_BITMAP_HAM8    (1<<PIXFMTB_BITMAP+COLORMODE_HAM8)
  207. #define    PIXFMT_BITMAP_HAM6    (1<<PIXFMTB_BITMAP+COLORMODE_HAM6)
  208.  
  209. #define    PIXFMT_RGB_24            (1<<PIXFMTB_RGB+1)
  210.  
  211. /*
  212.  *    strictly internal:
  213.  */
  214.  
  215. #define PIXFMT_BITMAP_RGB        (1<<PIXFMTB_BITMAP+1<<PIXFMTB_RGB)
  216.  
  217.  
  218. /************************************************************************
  219.  
  220.     ExtractPalette return codes
  221.  
  222.     You must at least check for EXTP_SUCCESS.
  223.     EXTP_NO_DATA indicates that there were no colors
  224.     in the histogram.
  225.  
  226. ************************************************************************/
  227.  
  228. #define    EXTP_SUCCESS            0
  229. #define    EXTP_NOT_ENOUGH_MEMORY    1
  230. #define    EXTP_CALLBACK_ABORTED    2
  231. #define    EXTP_NO_DATA            3
  232.  
  233.  
  234. /************************************************************************
  235.  
  236.     AddRGB, AddRGBImage and AddChunkyImage return codes
  237.  
  238.     You must at least check for ADDH_SUCCESS.
  239.     If not delivered, the histogram might be
  240.     inaccurate.
  241.  
  242. ************************************************************************/
  243.  
  244. #define    ADDH_SUCCESS                0
  245. #define    ADDH_NOT_ENOUGH_MEMORY        1
  246. #define    ADDH_CALLBACK_ABORTED        2
  247. #define ADDH_NO_DATA                3
  248.  
  249.  
  250. /************************************************************************
  251.  
  252.     Render return codes
  253.  
  254.     You must at least check for REND_SUCCESS.
  255.     If not delivered, the image has not been
  256.     rendered completely.
  257.  
  258. ************************************************************************/
  259.  
  260. #define    REND_SUCCESS                0
  261. #define    REND_NOT_ENOUGH_MEMORY        1
  262. #define    REND_CALLBACK_ABORTED        2
  263. #define    REND_NO_VALID_PALETTE        3
  264.  
  265.  
  266. /************************************************************************
  267.  
  268.     SortPalette return codes
  269.  
  270.     You must at least check for SORTP_SUCCESS.
  271.     SORTP_NO_DATA indicates that there were data missing,
  272.     e.g. you specified no histogram or the histogram was empty.
  273.  
  274. ************************************************************************/
  275.  
  276. #define    SORTP_SUCCESS                0
  277. #define    SORTP_NO_DATA                1
  278. #define    SORTP_NOT_ENOUGH_MEMORY        2
  279.  
  280.  
  281. /************************************************************************
  282.  
  283.     conversion return codes
  284.  
  285.     These return codes apply to conversion functions
  286.     such as Chunky2RGB and ConvertChunky.
  287.  
  288. ************************************************************************/
  289.  
  290. #define    CONV_SUCCESS                0
  291. #define    CONV_CALLBACK_ABORTED        1
  292. #define CONV_NOT_ENOUGH_MEMORY        2
  293.  
  294.  
  295. /***********************************************************************/
  296.  
  297. #endif
  298.